<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
function func_message_feedback_subject($messages_subject) {
	$feedback_subject = 'Re: ' . $messages_subject;
	
	return $feedback_subject;
}

function func_message_feedback_content($messages_content) {
	$feedback_content = "\n\n\n\nOriginal Message: \n\n";
	
	//$messages_content_lines = preg_split("\n", $messages_content, -1, PREG_SPLIT_OFFSET_CAPTURE);
	$messages_content_lines = explode("\n", $messages_content);
	if( sizeof($messages_content_lines) > 0 ) {
		for($i=0; $i<sizeof($messages_content_lines); $i++) {
			$messages_content_lines[$i] = '> ' . $messages_content_lines[$i];
		}
		
		$feedback_content .= implode("\n", $messages_content_lines);
	} else {
		$feedback_content .= '> ' . $messages_content;
	}
	
	return $feedback_content;
}
//
?>